package com.iocollege.tinyframe.mapper.system;

import com.iocollege.tinyframe.common.core.MyMapper;
import com.iocollege.tinyframe.entity.system.SysDictData;
import com.iocollege.tinyframe.entity.system.SysDictType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 字典类型表 Mapper 接口
 * </p>
 *
 * @author 关注公众号：MarkerHub
 * @since 2021-04-07
 */
public interface SysDictTypeMapper extends MyMapper<SysDictType> {

    @Select("select * from sys_dict_data where status = '0' and dict_type = #{dictType} order by dict_sort asc")
    List<SysDictData> selectDictDataByType(String dictType);

    @Select("select * from sys_dict_type  where dict_type = #{dictType} limit 1")
    SysDictType checkDictTypeUnique(String dictType);
}
